/* ******* Blue Rotations ******** */

void b1(struct aCube * cube) {
	b1c( cube );
	b1e( cube );
}

void b2(struct aCube * cube) {
	b2c( cube );
	b2e( cube );
}

void b3(struct aCube * cube) {
	b3c( cube );
	b3e( cube );
}

void b1c(struct aCube * cube) {

	short temp = cube[C4].b;
	cube[C4].b = cube[C5].b;
	cube[C5].b = cube[C6].b;
	cube[C6].b = cube[C2].b;
	cube[C2].b = temp;

	temp = cube[C4].w;
	cube[C4].w = cube[C5].r;
	cube[C5].r = cube[C6].y;
	cube[C6].y = cube[C2].o;
	cube[C2].o = temp;

	temp = cube[C4].r;
	cube[C4].r = cube[C5].y;
	cube[C5].y = cube[C6].o;
	cube[C6].o = cube[C2].w;
	cube[C2].w = temp;

        temp = cube[C4].pos;
        cube[C4].pos = cube[C5].pos;
        cube[C5].pos = cube[C6].pos;
        cube[C6].pos = cube[C2].pos;
        cube[C2].pos = temp;
}

void b1e(struct aCube * cube) {

	short temp = cube[E10].b;
	cube[E10].b = cube[E18].b;
	cube[E18].b = cube[E13].b;
	cube[E13].b = cube[E19].b;
	cube[E19].b = temp;
  
	temp = cube[E10].w;
	cube[E10].w = cube[E18].r;
	cube[E18].r = cube[E13].y;
	cube[E13].y = cube[E19].o;
	cube[E19].o = temp;

        temp = cube[E10].pos;
        cube[E10].pos = cube[E18].pos;
        cube[E19].pos = cube[E13].pos;
        cube[E13].pos = cube[E19].pos;
        cube[E19].pos = temp;
}

void b2c(struct aCube * cube) {

	short temp = cube[C4].b;
	cube[C4].b = cube[C6].b;
	cube[C6].b = temp;
	temp = cube[C2].b;
	cube[C2].b = cube[C5].b;
	cube[C5].b = temp;

	temp = cube[C4].w;
	cube[C4].w = cube[C6].y;
	cube[C6].y = temp;
	temp = cube[C4].r;
	cube[C4].r = cube[C6].o;
	cube[C6].o = temp;

	temp = cube[C2].w;
	cube[C2].w = cube[C5].y;
	cube[C5].y = temp;
	temp = cube[C2].o;
	cube[C2].o = cube[C5].r;
	cube[C5].r = temp;

        temp = cube[C4].pos;
        cube[C4].pos = cube[C6].pos;
        cube[C6].pos = temp;
        temp = cube[C2].pos;
        cube[C2].pos = cube[C5].pos;
        cube[C5].pos = temp;
}


void b2e(struct aCube * cube) {

	short temp = cube[E10].b;
	cube[E10].b = cube[E13].b;
	cube[E13].b = temp;
	temp = cube[E18].b;
	cube[E18].b = cube[E19].b;
	cube[E19].b = temp;

	temp = cube[E10].w;
	cube[E10].w = cube[E13].y;
	cube[E13].y = temp;
	temp = cube[E18].r;
	cube[E18].r = cube[E19].o;
	cube[E19].o = temp;

        temp = cube[E10].pos;
        cube[E10].pos = cube[E13].pos;
        cube[E13].pos = temp;
        temp = cube[E19].pos;
        cube[E19].pos = cube[E18].pos;
        cube[E18].pos = temp;
}

void b3c(struct aCube * cube) {

	short temp = cube[C4].b;
	cube[C4].b = cube[C2].b;
	cube[C2].b = cube[C6].b;
	cube[C6].b = cube[C5].b;
	cube[C5].b = temp;

	temp = cube[C4].w;
	cube[C4].w = cube[C2].o;
	cube[C2].o = cube[C6].y;
	cube[C6].y = cube[C5].r;
	cube[C5].r = temp;

	temp = cube[C4].o;
	cube[C4].o = cube[C2].y;
	cube[C2].y = cube[C6].r;
	cube[C6].r = cube[C5].w;
	cube[C5].w = temp;

        temp = cube[C4].pos;
        cube[C4].pos = cube[C2].pos;
        cube[C2].pos = cube[C6].pos;
        cube[C6].pos = cube[C5].pos;
        cube[C5].pos = temp;
}

void b3e(struct aCube * cube) {

	short temp = cube[E10].b;
	cube[E10].b = cube[E19].b;
	cube[E19].b = cube[E13].b;
	cube[E13].b = cube[E18].b;
	cube[E18].b = temp;

	temp = cube[E10].w;
	cube[E10].w = cube[E19].o;
	cube[E19].o = cube[E13].y;
	cube[E13].y = cube[E18].r;
	cube[E18].r = temp;

        temp = cube[E10].pos;
        cube[E18].pos = cube[E19].pos;
        cube[E19].pos = cube[E13].pos;
        cube[E13].pos = cube[E18].pos;
        cube[E18].pos = temp;
}
